home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -serious- / programming / e / lsestuff / old / d1da.e next >
Text File  |  1999-11-29  |  767b  |  50 lines

  1. OPT MODULE
  2.  
  3. MODULE 'myoo/xl'
  4.  
  5. OBJECT point OF xni
  6.    value
  7. ENDOBJECT
  8.  
  9. EXPORT OBJECT d1da OF xli
  10.    PRIVATE
  11.    unsetvalue
  12. ENDOBJECT
  13.  
  14.  
  15. PROC d1da() OF d1da IS EMPTY
  16.  
  17. PROC end() OF d1da
  18.    self.fastdisposeall(SIZEOF point)
  19. ENDPROC
  20.  
  21. PROC set(x, value) OF d1da
  22.    DEF point:PTR TO point
  23.    point:=self.find(x)
  24.    IF point = NIL
  25.       point:=FastNew(SIZEOF point)
  26.       self.addtail(point)
  27.       point.id:=x
  28.    ENDIF
  29.    point.value:=value
  30. ENDPROC
  31.  
  32. PROC get(x) OF d1da
  33.    DEF point:PTR TO point
  34.    point:=self.find(x)
  35. ENDPROC point.value
  36.  
  37. PROC unset(x) OF d1da
  38.    DEF point:PTR TO point
  39.    point:=self.find(x)
  40.    IF point = NIL THEN RETURN NIL
  41.    self.remove(point)
  42.    FastDispose(point, SIZEOF point)
  43. ENDPROC
  44.  
  45. PROC unsetvalue(val) OF d1da
  46.    self.unsetvalue:=val
  47. ENDPROC
  48.  
  49.  
  50.